<page-header [title]="l('Maintenance')"></page-header>

<nz-card>
  <nz-tabset>
    <!-- 缓存 -->
    <nz-tab [nzTitle]="l('Caching')">
      <nz-card [nzBordered]="false" [nzExtra]="cachingExtra" [nzTitle]="l('CachesHeaderInfo')">
        <ng-template #cachingExtra>
          <button nz-button [nzType]="'primary'" (click)="clearAllCaches()">
            <i class="anticon anticon-delete"></i>
            <span>{{l("ClearAll")}}</span>
          </button>
        </ng-template>

        <!-- <nz-table #ajaxTable [nzData]="dataList" [nzLoading]="isTableLoading" [nzShowPagination]="false">
          <thead nz-thead>
            <tr>
              <th nz-th></th>
              <th nz-th></th>
            </tr>
          </thead>
          <tbody nz-tbody>
            <tr nz-tbody-tr *ngFor="let item of ajaxTable.data">
              <td>
                {{item.name}}
              </td>
              <td nz-td>
                <a (click)="clearCache(item.name)">
                  {{l("Clear")}}
                </a>
              </td>
            </tr>
          </tbody>
        </nz-table> -->
      </nz-card>
    </nz-tab>

    <!-- 网站日志 -->
    <nz-tab [nzTitle]="l('WebSiteLog')">
      <nz-card [nzBordered]="false" [nzExtra]="webSiteLogExtra" [nzTitle]="l('WebSiteLogsHeaderInfo')">
        <ng-template #webSiteLogExtra>
          <button nz-button [nzType]="'primary'" (click)="downloadWebLogs()">
            <i class="anticon anticon-download"></i>
            <span>{{l("DownloadAll")}}</span>
          </button>
          <button nz-button [nzType]="'primary'" (click)="getWebLogs()">
            <i class="anticon anticon-reload"></i>
            <span>{{l("Refresh")}}</span>
          </button>
        </ng-template>
        <div class="web-log-view full-height">
          <div class="log-line" *ngFor="let log of logs">
            <span [class]="getLogClass(log)">{{getLogType(log)}}</span>
            {{getRawLogContent(log)}}
          </div>
        </div>
      </nz-card>
    </nz-tab>

  </nz-tabset>

</nz-card>
